# !/usr/bin bash
echo "===========本脚本主要是复制部署文件到服务器============="

echo "请输入您的服务器用户名:"
read username
if [[ ! $username ]]; then
  echo "$0 username is required"
  exit 1
fi

remotessh=${username}@121.196.20.11

#设置一下
echo -n "请输入您的服务器密码："
read password
if [[ ! $password ]]; then
  echo "$0 password is required"
  exit 1
fi

sshpass -p '$password' ssh ${remotessh} "cd /home/guomw ; rm -rf mall-*;rm -rf run.sh"

sshpass -p "$password" scp -r mall-manager/ ${remotessh}:/home/guomw/
sshpass -p "$password" scp -r mall-api/ ${remotessh}:/home/guomw/
sshpass -p "$password" scp -r run.sh ${remotessh}:/home/guomw/
